{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'all_instruments' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m/home/wxg/sda7/myfiles/giteeprojects/QUANTAXIS/config/test.ipynb Cell 1\u001b[0m line \u001b[0;36m3\n\u001b[1;32m      <a href='vscode-notebook-cell:/home/wxg/sda7/myfiles/giteeprojects/QUANTAXIS/config/test.ipynb#W0sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39mQUANTAXIS\u001b[39;00m \u001b[39mas\u001b[39;00m \u001b[39mQA\u001b[39;00m\n\u001b[1;32m      <a href='vscode-notebook-cell:/home/wxg/sda7/myfiles/giteeprojects/QUANTAXIS/config/test.ipynb#W0sZmlsZQ%3D%3D?line=1'>2</a>\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39mdata_init\u001b[39;00m\n\u001b[0;32m----> <a href='vscode-notebook-cell:/home/wxg/sda7/myfiles/giteeprojects/QUANTAXIS/config/test.ipynb#W0sZmlsZQ%3D%3D?line=2'>3</a>\u001b[0m dm\u001b[39m=\u001b[39mdata_init\u001b[39m.\u001b[39;49mdatamodelx(market\u001b[39m=\u001b[39;49m\u001b[39m\"\u001b[39;49m\u001b[39mstock_cn\u001b[39;49m\u001b[39m\"\u001b[39;49m,frequence\u001b[39m=\u001b[39;49m\u001b[39m'\u001b[39;49m\u001b[39mday\u001b[39;49m\u001b[39m'\u001b[39;49m)\n\u001b[1;32m      <a href='vscode-notebook-cell:/home/wxg/sda7/myfiles/giteeprojects/QUANTAXIS/config/test.ipynb#W0sZmlsZQ%3D%3D?line=3'>4</a>\u001b[0m dm\u001b[39m.\u001b[39mcreate_table()\n",
      "File \u001b[0;32m~/sda7/myfiles/giteeprojects/QUANTAXIS/config/data_init.py:83\u001b[0m, in \u001b[0;36mdatamodelx.__init__\u001b[0;34m(self, market, frequence)\u001b[0m\n\u001b[1;32m     77\u001b[0m \u001b[39m# clickhouse://[user:password]@localhost:9000/default{}\u001b[39;00m\n\u001b[1;32m     78\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mclient \u001b[39m=\u001b[39m clickhouse_driver\u001b[39m.\u001b[39mClient(host\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mlocalhost\u001b[39m\u001b[39m'\u001b[39m, database\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mquantaxis\u001b[39m\u001b[39m'\u001b[39m,user\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39m'\u001b[39m, password\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39m#\u001b[39m\u001b[39m'\u001b[39m,\n\u001b[1;32m     79\u001b[0m                                        settings\u001b[39m=\u001b[39m{\n\u001b[1;32m     80\u001b[0m                                            \u001b[39m'\u001b[39m\u001b[39minsert_block_size\u001b[39m\u001b[39m'\u001b[39m: \u001b[39m100000000\u001b[39m},\n\u001b[1;32m     81\u001b[0m                                        compression\u001b[39m=\u001b[39m\u001b[39mTrue\u001b[39;00m)\n\u001b[0;32m---> 83\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcodelist \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mget_list()\u001b[39m.\u001b[39msort_values(\u001b[39m'\u001b[39m\u001b[39mlisted_date\u001b[39m\u001b[39m'\u001b[39m, ascending\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m)\n\u001b[1;32m     84\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mtemp_data \u001b[39m=\u001b[39m []\n",
      "File \u001b[0;32m~/sda7/myfiles/giteeprojects/QUANTAXIS/config/data_init.py:662\u001b[0m, in \u001b[0;36mdatamodelx.get_list\u001b[0;34m(self, date)\u001b[0m\n\u001b[1;32m    617\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mget_list\u001b[39m(\u001b[39mself\u001b[39m, date\u001b[39m=\u001b[39m\u001b[39mNone\u001b[39;00m):\n\u001b[1;32m    618\u001b[0m \u001b[39m    \u001b[39m\u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m    619\u001b[0m \u001b[39m    order_book_id\tstr\t证券代码，证券的独特的标识符。应以'.XSHG'或'.XSHE'或'.XHKG'结尾。 '.XSHG' - 上证，'.XSHE' - 深证， '.XHKG' - 港股\u001b[39;00m\n\u001b[1;32m    620\u001b[0m \u001b[39m    symbol\tstr\t证券的简称，例如'平安银行'\u001b[39;00m\n\u001b[0;32m   (...)\u001b[0m\n\u001b[1;32m    659\u001b[0m \u001b[39m    product\tstr\t合约种类，'Commodity'-商品期货，'Index'-股指期货，'Government'-国债期货\u001b[39;00m\n\u001b[1;32m    660\u001b[0m \u001b[39m    \"\"\"\u001b[39;00m\n\u001b[0;32m--> 662\u001b[0m     \u001b[39mreturn\u001b[39;00m all_instruments(\u001b[39mtype\u001b[39m\u001b[39m=\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mmarket_dict[\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mmarket], market\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mcn\u001b[39m\u001b[39m'\u001b[39m, date\u001b[39m=\u001b[39mdate)\n",
      "\u001b[0;31mNameError\u001b[0m: name 'all_instruments' is not defined"
     ]
    }
   ],
   "source": [
    "import QUANTAXIS as QA\n",
    "import data_init\n",
    "dm=data_init.datamodelx(market=\"stock_cn\",frequence='day')\n",
    "dm.create_table()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "quantaxis",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.18"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
